home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Scheduling / Cassandra / Source / future / convert / OldEvent.h < prev    next >
Encoding:
Text File  |  1990-06-10  |  5.3 KB  |  163 lines

  1. //
  2. // OldEvent.h
  3. // Copyright (c) 1989, 1990 by Jiro Nakamura 
  4. // All rights reserved
  5. //
  6. // Interface definition of class Event. Event handles the database management
  7. // of Cassandra.
  8. // This is for convert. Using Event.h v1.7, modified 90/01/08
  9. //
  10. // RCS Information
  11. // Revision Number->    $Revision: 1.7 $
  12. // Last Revised->        $Date: 90/01/08 02:51:11 $
  13. //
  14.  
  15. #import <objc/Object.h>
  16. #import <time.h>
  17. #import "cass.h"    
  18.  
  19.  
  20. @interface OldEvent : Object
  21. {
  22.     EFileLink    present, previous, next;    // links to previous and next records and itself 
  23.                                 // See documentation for queue implementation
  24.                                 // details
  25.     struct tm ts;        // time structure  see ctime(3) for details 
  26.     int     priority,        // Priority of message (when it gets viewed) 
  27.         destroy,        // Destroy after message?     0= never destroy
  28.                     //  1 = destroy immediately after, 2...n = destroy after n calls 
  29.         anniversary,    // Anniversary event, 0 = no anniversary 
  30.                     // (int) (anniversary / 100) is the "base interval": 
  31.                     //  1 = daily      
  32.                     //  2 = weekly
  33.                     //  3 = monthly
  34.                     //  4 = yearly
  35.                     // anniversary % 100 is the number of "base interval" that
  36.                     // make up the "true interval" between anniversary events
  37.         sleepNo,        // No of sleep times allowed 
  38.         sleepInt;        // The sleep intervals themselves  (in minutes) 
  39.     char alarmSound[128];    /* The alarm sound name */
  40.     char msg[MESSAGE_SIZE];    /* message buffer */
  41.  
  42.     id global;
  43.     char eventFile[128];
  44. }
  45. // Constructor:        newAt: (const char *) eFile;
  46. // Description:        Constructs new object instance of Event, with the Event
  47. //                reading the file <eFile>
  48. +newAt: (const char *) eFile;
  49.  
  50. /* low level routines  dealing with event links themselves */ 
  51.  
  52. // Method:        readEvent : (EFileLink) here
  53. // Arguments:        (EFileLink) here  -> the EFileLink in the queue to read from
  54. // Description:        Reads the event directly from the queue with <here> as the
  55. //                index.
  56. // Return Value:    <self>
  57. - readEvent : (EFileLink) here;    
  58.  
  59.  
  60. // Method:        writeEvent : (EFileLink) here
  61. // Arguments:        (EFileLink) here  -> the EFileLink in the queue to write to
  62. // Description:        Writes the event directly into the queue with <here> as the
  63. //                index. Note that this is not an insert, so the next and previous
  64. //                pointers from the last read from this event should be preserved
  65. //                or new pointers should be made and changed appopriately.
  66. // Return Value:    <self>
  67. - writeEvent : (EFileLink) here;     /* write itself into the event file */
  68.  
  69.  
  70.  
  71. /* Higher level methods that deal somewhat abstractly with the queue */        
  72.  
  73. // Method:        firstEvent
  74. // Arguments:        None.
  75. // Description:        reads the first event. Equivalent to:
  76. //                [ev readEvent:0];
  77. //                [ev readEvent:  [ev next]];
  78. // Return Value:    returns with the first event read into its internals
  79. - firstEvent;            
  80.  
  81.  
  82. // Method:        (EFileLink) insertEvent
  83. // Arguments:        None, event to be inserted must be already in object
  84. // Description:        Inserts itself into the queue. It is sufficiently intelligent
  85. //                enough to convert all mistaken dates and times into the
  86. //                proper format before inserting itself, so that other
  87. //                modules that use it can simply add blindly to dates.
  88. //                insertEvent is equivalent to insertEventFrom: 1
  89. // Return Value:    The particular EFileLink that it inserted itself into.
  90. - (EFileLink) insertEvent;    
  91.  
  92.  
  93. // Method:        (EFileLink) insertEventFrom: (EFileLink) here
  94. // Arguments:        (EFileLink) here   -> start inserting from <here>
  95. // Description:        Same as insertEvent except that the search for empty events
  96. //                starts from <here>, so that if you KNOW where an deleted
  97. //                EFileLink is, then you can use this method to speed things up
  98. //                 somewhat.
  99. // ReturnValue:    The particular EFileLink that it inserted itself into.
  100. - (EFileLink) insertEventFrom: (EFileLink) here;
  101.  
  102.  
  103. // Method:        deleteEvent: (EFileLink) here
  104. // Arguments:        (EFileLink) here   -> the event to delete
  105. // Description:        Delete the event <here>
  106. // Return Value:    <self>
  107. - deleteEvent : (EFileLink) here;    
  108.  
  109.  
  110. // Method:        int murderEvent : (EFileLink) here
  111. // Arguments:        (EFileLink) here   -> the event to "murder"
  112. // Description:        "Murdering" an event deletes an event, but if it is an anniversary
  113. //                event, then it reinstalls it appropriately in the future. See above
  114. //                for description of state variables for "anniversary" events.
  115. // Return Value:    The EFileLink where the new event lies.  -1 if it was not
  116. //                reinserted
  117. - (int) murderEvent : (EFileLink) here;    
  118.  
  119. /*  Accessors */
  120. /* See heading above for description of these variables */
  121. - (EFileLink) present;    
  122. - (EFileLink) previous;
  123. - (EFileLink) next;
  124. - (int) destroy;
  125. - (int) priority;
  126. - (int) anniversary;
  127. - (int) sleepNo;
  128. - (int) sleepInt;
  129. - (char *) alarmSound;
  130. - (char *) message;
  131. - (struct tm *) time;
  132. - (int) mday;            // These access the time structure directly, instead of
  133. - (int) mon;            // using the structure accessors
  134. - (int) year;
  135. - (int) hour;
  136. - (int) min;
  137. - (int) sec;
  138. - (int) wday;
  139. - (int) yday;
  140.  
  141. - setPresent : (EFileLink) apresent;
  142. - setPrevious : (EFileLink) aprevious;
  143. - setNext : (EFileLink) anext;
  144. - setDestroy : (int) dst;
  145. - setPriority : (int) si;
  146. - setAnniversary : (int) anv;
  147. - setSleepNo : (int) sn;
  148. - setSleepInt : (int) si;
  149. - setAlarmSound : (char *) alarmSound;
  150. - setMessage : (char *) message;
  151. - setTime : (struct tm *) time;
  152. - setMday : (int) x;
  153. - setMon: (int) x;
  154. - setYear: (int) x;
  155. - setHour: (int) x;
  156. - setMin: (int) x;
  157. - setSec: (int) x;
  158. - setWday: (int) x;
  159. - setYday:(int) x;
  160. @end
  161.  
  162.  
  163.